Optimal. Leaf size=82 \[ -\frac {2 a^2 \cot ^3(c+d x)}{3 d}+\frac {5 a^2 \tanh ^{-1}(\cos (c+d x))}{8 d}-\frac {a^2 \cot (c+d x) \csc ^3(c+d x)}{4 d}-\frac {3 a^2 \cot (c+d x) \csc (c+d x)}{8 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.20, antiderivative size = 82, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 6, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.207, Rules used = {2873, 2611, 3770, 2607, 30, 3768} \[ -\frac {2 a^2 \cot ^3(c+d x)}{3 d}+\frac {5 a^2 \tanh ^{-1}(\cos (c+d x))}{8 d}-\frac {a^2 \cot (c+d x) \csc ^3(c+d x)}{4 d}-\frac {3 a^2 \cot (c+d x) \csc (c+d x)}{8 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 30
Rule 2607
Rule 2611
Rule 2873
Rule 3768
Rule 3770
Rubi steps
\begin {align*} \int \cot ^2(c+d x) \csc ^3(c+d x) (a+a \sin (c+d x))^2 \, dx &=\int \left (a^2 \cot ^2(c+d x) \csc (c+d x)+2 a^2 \cot ^2(c+d x) \csc ^2(c+d x)+a^2 \cot ^2(c+d x) \csc ^3(c+d x)\right ) \, dx\\ &=a^2 \int \cot ^2(c+d x) \csc (c+d x) \, dx+a^2 \int \cot ^2(c+d x) \csc ^3(c+d x) \, dx+\left (2 a^2\right ) \int \cot ^2(c+d x) \csc ^2(c+d x) \, dx\\ &=-\frac {a^2 \cot (c+d x) \csc (c+d x)}{2 d}-\frac {a^2 \cot (c+d x) \csc ^3(c+d x)}{4 d}-\frac {1}{4} a^2 \int \csc ^3(c+d x) \, dx-\frac {1}{2} a^2 \int \csc (c+d x) \, dx+\frac {\left (2 a^2\right ) \operatorname {Subst}\left (\int x^2 \, dx,x,-\cot (c+d x)\right )}{d}\\ &=\frac {a^2 \tanh ^{-1}(\cos (c+d x))}{2 d}-\frac {2 a^2 \cot ^3(c+d x)}{3 d}-\frac {3 a^2 \cot (c+d x) \csc (c+d x)}{8 d}-\frac {a^2 \cot (c+d x) \csc ^3(c+d x)}{4 d}-\frac {1}{8} a^2 \int \csc (c+d x) \, dx\\ &=\frac {5 a^2 \tanh ^{-1}(\cos (c+d x))}{8 d}-\frac {2 a^2 \cot ^3(c+d x)}{3 d}-\frac {3 a^2 \cot (c+d x) \csc (c+d x)}{8 d}-\frac {a^2 \cot (c+d x) \csc ^3(c+d x)}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 0.11, size = 209, normalized size = 2.55 \[ a^2 \left (-\frac {\tan \left (\frac {1}{2} (c+d x)\right )}{3 d}+\frac {\cot \left (\frac {1}{2} (c+d x)\right )}{3 d}-\frac {\csc ^4\left (\frac {1}{2} (c+d x)\right )}{64 d}-\frac {3 \csc ^2\left (\frac {1}{2} (c+d x)\right )}{32 d}+\frac {\sec ^4\left (\frac {1}{2} (c+d x)\right )}{64 d}+\frac {3 \sec ^2\left (\frac {1}{2} (c+d x)\right )}{32 d}-\frac {5 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )}{8 d}+\frac {5 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )}{8 d}-\frac {\cot \left (\frac {1}{2} (c+d x)\right ) \csc ^2\left (\frac {1}{2} (c+d x)\right )}{12 d}+\frac {\tan \left (\frac {1}{2} (c+d x)\right ) \sec ^2\left (\frac {1}{2} (c+d x)\right )}{12 d}\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.51, size = 155, normalized size = 1.89 \[ -\frac {32 \, a^{2} \cos \left (d x + c\right )^{3} \sin \left (d x + c\right ) - 18 \, a^{2} \cos \left (d x + c\right )^{3} + 30 \, a^{2} \cos \left (d x + c\right ) - 15 \, {\left (a^{2} \cos \left (d x + c\right )^{4} - 2 \, a^{2} \cos \left (d x + c\right )^{2} + a^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + 15 \, {\left (a^{2} \cos \left (d x + c\right )^{4} - 2 \, a^{2} \cos \left (d x + c\right )^{2} + a^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{48 \, {\left (d \cos \left (d x + c\right )^{4} - 2 \, d \cos \left (d x + c\right )^{2} + d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.24, size = 164, normalized size = 2.00 \[ \frac {3 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 16 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 24 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 120 \, a^{2} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) - 48 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + \frac {250 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 48 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 24 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 16 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4}}}{192 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.31, size = 112, normalized size = 1.37 \[ -\frac {5 a^{2} \left (\cos ^{3}\left (d x +c \right )\right )}{8 d \sin \left (d x +c \right )^{2}}-\frac {5 a^{2} \cos \left (d x +c \right )}{8 d}-\frac {5 a^{2} \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{8 d}-\frac {2 a^{2} \left (\cos ^{3}\left (d x +c \right )\right )}{3 d \sin \left (d x +c \right )^{3}}-\frac {a^{2} \left (\cos ^{3}\left (d x +c \right )\right )}{4 d \sin \left (d x +c \right )^{4}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.34, size = 130, normalized size = 1.59 \[ -\frac {3 \, a^{2} {\left (\frac {2 \, {\left (\cos \left (d x + c\right )^{3} + \cos \left (d x + c\right )\right )}}{\cos \left (d x + c\right )^{4} - 2 \, \cos \left (d x + c\right )^{2} + 1} - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - 12 \, a^{2} {\left (\frac {2 \, \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{2} - 1} + \log \left (\cos \left (d x + c\right ) + 1\right ) - \log \left (\cos \left (d x + c\right ) - 1\right )\right )} + \frac {32 \, a^{2}}{\tan \left (d x + c\right )^{3}}}{48 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 8.62, size = 161, normalized size = 1.96 \[ \frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2}{8\,d}+\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3}{12\,d}+\frac {a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{64\,d}-\frac {5\,a^2\,\ln \left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{8\,d}-\frac {{\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (-4\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+2\,a^2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\frac {4\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{3}+\frac {a^2}{4}\right )}{16\,d}-\frac {a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{4\,d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________